package com.sunshine.wrongquestionset.activity.base

import android.app.Application
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.LiveData
import com.sunshine.wrongquestionset.room.entity.AppConfigEntity
import com.sunshine.wrongquestionset.room.repository.MyRepository

/**
 * @author sunshine
 * @date 2021/3/29
 */
class BaseViewModel(application: Application): AndroidViewModel(application) {
    private val repository: MyRepository = MyRepository(application.applicationContext)

    fun getLoginUser(): LiveData<String?> {
        return repository.getLoginUserId()
    }

    fun getLoginUserAppConfig(userId: String): LiveData<AppConfigEntity> {
        return repository.getAppConfig(userId)
    }
}